/**
 * 
 */
package kr.co.insoft.driver.openstack.model;

import kr.co.insoft.driver.model.InstanceModel;

import org.jclouds.compute.domain.NodeMetadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author IN-SOFT Inc. skpark@in-soft.co.kr
 * 
 */
public class OpenStackInstanceModel extends InstanceModel {


	/**
	 * 
	 */
	private static final long serialVersionUID = -5371224779800710086L;
	
	private static final Logger logger = LoggerFactory
			.getLogger(OpenStackInstanceModel.class);

	public OpenStackInstanceModel() {

	}

	/**
	 * @param nodeMetadata
	 */
	public OpenStackInstanceModel(NodeMetadata nodeMetadata) {
		if (logger.isDebugEnabled()) {
			logger.debug("ComputeMetadata : {}", nodeMetadata);
		}
		setImageId(nodeMetadata.getImageId());
		setInstanceId(nodeMetadata.getId());
		setInstanceName(nodeMetadata.getName());
		setPrivateIpAddress(nodeMetadata.getPrivateAddresses());
		setPublicIpAddress(nodeMetadata.getPublicAddresses());
		setPublicDnsName(nodeMetadata.getHostname());
	}
}
